const mongoose = require('mongoose');

// 构建角色模型
const Schema = mongoose.Schema;

const roleSchema = new Schema({
    name: {
        type: String,
        unique: true,
        require: true,
        index: 1
    },
    article_type: { // 是否为文章类型
        type: Boolean,
        default: false
    },
    createDate: {
        type: Date,
        default: Date.now
    },
    upDate: {
        type: Date,
        default: Date.now
    }
});
module.exports = mongoose.model('role', roleSchema);
